<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        body {
            font-family: 'Arial', sans-serif;
            width: 350px;
            padding: 15px;
            height: 500px;
            display: flex;
            flex-direction: column;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .title {
            font-size: 16px;
            font-weight: bold;
            color: #333;
        }

        .container {
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 15px;
            flex: 1;
            overflow: hidden;
        }

        .form-group {
            width: 100%;
            flex: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        label {
            display: block;
            margin-bottom: 5px;
            font-size: 14px;
            color: #333;
            font-weight: bold;
        }

        #bookmarkTree, #resultTree {
            flex: 1;
            overflow-y: auto;
            border: 1px solid #ccc;
            border-radius: 4px;
            padding: 10px;
            background-color: #f9f9f9;
        }

        #resultSection {
            display: none; /* 默认隐藏结果区域 */
        }

        #exportBtn {
            background-color: #4285f4;
            color: white;
            border: none;
            padding: 10px 15px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.3s;
            width: 100%;
        }

        #exportBtn:hover {
            background-color: #3367d6;
        }

        #viewResultBtn {
            background-color: #34a853;
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            transition: background-color 0.3s;
        }

        #viewResultBtn:hover {
            background-color: #2d9249;
        }

        .toast {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 12px 20px;
            border-radius: 4px;
            font-size: 14px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s;
            text-align: center;
            max-width: 80%;
        }

        .toast.show {
            opacity: 1;
        }

        /* 树形结构样式 */
        .tree-node {
            margin: 2px 0;
            position: relative;
        }

        .tree-content {
            display: flex;
            align-items: center;
            padding: 3px 0;
        }

        .tree-toggle {
            width: 16px;
            height: 16px;
            margin-right: 5px;
            cursor: pointer;
            text-align: center;
            line-height: 16px;
            font-size: 12px;
            color: #666;
        }

        .tree-label {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            cursor: pointer;
            font-size: 13px;
            padding: 2px 4px;
            border-radius: 3px;
        }

        .tree-label:hover {
            background-color: #e6f4ff;
        }

        .tree-children {
            margin-left: 20px;
            display: none;
        }

        .tree-expanded > .tree-children {
            display: block;
        }

        .tree-folder {
            color: #1a73e8;
        }

        .tree-bookmark {
            color: #333;
        }

        .tree-selected > .tree-content > .tree-label {
            background-color: #e6f4ff;
            font-weight: bold;
        }

        .tree-checkbox {
            margin-right: 5px;
        }

        /* 结果树特殊样式 */
        .result-valid {
            color: #34a853;
        }

        .result-invalid {
            color: #ea4335;
        }

        .result-warning {
            color: #fbbc05;
        }

        .back-btn {
            color: #4285f4;
            cursor: pointer;
            font-size: 14px;
            margin-bottom: 10px;
            display: none;
        }

        .back-btn:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div class="header">
    <div class="title">书签验证工具</div>
    <button id="viewResultBtn">查看结果</button>
</div>

<div id="backBtn" class="back-btn">← 返回书签选择</div>

<div class="container">
    <div id="bookmarkSection" class="form-group">
        <label>选择要排除验证的书签或文件夹：</label>
        <div id="bookmarkTree"></div>
    </div>

    <div id="resultSection" class="form-group" style="display:none;">
        <label>验证结果：</label>
        <div id="resultTree"></div>
    </div>

    <button id="exportBtn">开始验证</button>
</div>
<div id="toast" class="toast"></div>
<script src="popup.js"></script>
</body>
</html>
